The present invention relates to a microcontroller having non-volatile memory.
When a conventional miocrocontroller having an internal non-volatile memory which is erasable and programmable is activated, an operation notification signal is first sent from a basic signal generation circuit to a program counter. Thereupon, the program counter operates, and an address is sent via an address bus and an address decoder to a ROM in which programs are stored. The instruction at the address in ROM corresponding to that address is then read out from the ROM to an instruction decoder via a data latch and a data bus, and is decoded. A control signal S.sub.c corresponding to the decoded instruction is sent from the instruction decoder to various parts of the microcontroller, and the instruction is executed.
In this conventional microcontroller, programs are recorded in ROM.
The process of developing programs for the above conventional type of microcontroller will now be described with reference to FIG. 6. During the development of a program, the specifications are first verified (step F71), then hardware that satisfies those specifications is selected (step F72). Software is then created in accordance with the selected hardware (step F73), and a program is coded (step F74). After debugging and evaluation of the program (step F75), both hardware and software are checked (step F76). If there is a problem in the software at this point, the flow returns to step F75 for re-verification. Similarly, if there is a hardware problem, and it is determined that the problem cannot be attributed to the software, the flow returns to step F71 for re-verification of the specifications, new hardware is selected, and the above steps are repeated. If there are no problems in the hardware or the software, the flow proceeds to the manufacture of samples of the microcontroller (step F77), and the system is evaluated on the basis of those samples (step F78). The process up to the manufacture of microprocessor samples (step F77) must ordinarily be repeated a number of times. If a problem is found during evaluation of the system containing one of the samples created as described above, the flow must return to step F75. In addition, if a hardware problem is found at this point, the flow must return to step F71 and all of the above steps must be repeated. If no problems are found during system evaluation, mass production and system introduction can start for the first time (step F80).
If, after the sample creation step, the developer finds an error in the program in ROM of a conventional microcontroller created in this way, samples must be manufactured again, no matter how small the correction that is required. This delays completion of the system, which delays its mass production.
If the programmable ROM is EPROM, the program can be easily corrected, but the package will require a window allowing the passage of ultra-violet light, which will increase the cost of the samples and impede mass production. Note that an alternative method using one-time PROM (in which the program can be written once only, and cannot be erased) could be used, but, as with EPROM, each individual program of a suite of programs must be written individually to ROM, impeding mass production.
Note that, in a conventional microcontroller containing non-volatile memory, all program data could be written to non-volatile memory, and such programs can be corrected. However, the writing of all the programs one-by-one to the non-volatile memory during mass production inevitably increases manufacturing costs.
There is another problem with this type of microcontroller in that, if processing routines of a program stored in ROM, for example, the processing routines in FIG. 7, are written to ROM in the sequence in which they are to be processed, the data recorded in ROM can be read out by an external means, making it simple for an unauthorized person to learn the algorithms of the program recorded in ROM.